<%@page contentType="text/html" %>
<%@page pageEncoding="UTF-8" %>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Goodwill - Топ самых востребованых позиций</title>
    <link rel="stylesheet" href="resources/css/main.css"/>
    <link rel="stylesheet" href="resources/css/stylesheet.css"/>
    <script type="text/javascript" src="resources/js/prototype.js"></script>
    <script type="text/javascript" src="resources/js/goodwill.js"></script>
    <style type="text/css">
        .rich-table-cell{
            font-size: 1.2em;
            text-align: center;
        }
    </style>
</head>
<body>
<f:view>
    <jsp:include page="menu.jsp"/>
    <jsp:include page="status.jsp"/>
    <h:form>
        <h:outputLink value="BalanseReport.jsf">
            <h:outputText value="Назад"/>
        </h:outputLink>
        <h:commandLink value="Выгрузить в excel" action="#{TopProductsBean.getExcel}" style="margin-left: 10px;"/>
    </h:form>
    <rich:dataTable value="#{TopProductsBean.topProductModels}" var="item" align="center" rowKeyVar="row" styleClass="full">
        <rich:column>
            <f:facet name="header">
                <h:outputText value="№"/>
            </f:facet>
            <h:outputText value="#{row + 1}"/>
        </rich:column>
        <rich:column>
            <f:facet name="header">
                <h:outputText value="Артикул"/>
            </f:facet>
            <h:outputText value="#{item.goodCode}"/>
        </rich:column>
        <rich:column>
            <f:facet name="header">
                <h:outputText value="На складе"/>
            </f:facet>
            <h:outputText value="#{item.goodCount}"/>
        </rich:column>
        <rich:column>
            <f:facet name="header">
                <h:outputText value="В резерве"/>
            </f:facet>
            <h:outputText value="#{item.goodReservedCount}"/>
        </rich:column>
        <rich:column>
            <f:facet name="header">
                <h:outputText value="Продажи за 12 мес."/>
            </f:facet>
            <h:outputText value="#{item.sales}"/>
        </rich:column>
        <rich:column>
            <f:facet name="header">
                <h:outputText value="Средние продажи за 1 мес."/>
            </f:facet>
            <h:outputText value="#{item.averageSalesPerMonth}"/>
        </rich:column>
        <rich:column>
            <f:facet name="header">
                <h:outputText value="Запас"/>
            </f:facet>
            <h:outputText value="#{item.stock}"/>
        </rich:column>
    </rich:dataTable>


</f:view>
</body>
</html>


